#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @Project : chat_model 
# @File    : file_extract.py
# @IDE     : PyCharm 
# @Author  :ZH
# @Time    : 2025/1/16 16:30
from fastapi import Security

from apps import logic
from apps.api.v1.file_extract_api import file_extract_router
from apps.api.v1.file_extract_api.schema import FileExtractListRequests, FileExtractListResponse
from apps.models import User
from apps.utils import get_current_user


@file_extract_router.post('/list', name='分页获取文本内容服务', response_model=FileExtractListResponse)
async def embedding_server_router(
        *,
        user: User = Security(get_current_user),
        query: FileExtractListRequests
):
    count, data = await logic.file_extract_logic.file_extract_list(query=query)
    return {
        'code': 0,
        "message": "成功",
        "count": count,
        "data": data
    }


